import request from '@/z/function/request.js';

// 分页查询待排线物流订单
export function preRoutePlanningInfoPage(query) {
	return request({
		url: '/pigx-logistics/routePlanningInfo/preRoutePlanningInfoPage',
		method: 'GET',
		params: query,
	});
}

// 分页查询待排线物流订单
export function addRoutePlanning(query) {
	return request({
		url: '/pigx-logistics/routePlanningInfo/addRoutePlanning',
		method: 'post',
		data: query,
	});
}
// 排线状态数量查询
export function count(query) {
	return request({
		url: '/pigx-logistics/routePlanningInfo/count',
		method: 'GET',
		params: query,
	});
}

//分页查询排线记录
export function routePlanningInfoRecordPage(query) {
	return request({
		url: '/pigx-logistics/routePlanningInfo/routePlanningInfoRecordPage',
		method: 'GET',
		data: query,
	});
}
//分页查询已排线记录
export function routePlanningInfoPage(query) {
	return request({
		url: '/pigx-logistics/routePlanningInfo/routePlanningInfoPage',
		method: 'GET',
		data: query,
	});
}
// 物流单已出排线
export function removeRoutePlanning(query) {
	return request({
		url: '/pigx-logistics/routePlanningInfo/removeRoutePlanning',
		method: 'post',
		data: query,
	});
}
// 出库
export function outbound(id) {
	return request({
		url: `/pigx-logistics/routePlanningInfo/outbound/${id}`,
		method: 'post',
		// data: query,
	});
}
// 发车 shipment
export function shipment(id) {
	return request({
		url: `/pigx-logistics/routePlanningInfo/shipment/${id}`,
		method: 'post',
		// data: query,
	});
}
// 到达
export function arrival(id,list) {
	let imgUrl = list.map(item => {
		return item.url
	}).join(',')
	return request({
		url: `/pigx-logistics/routePlanningInfo/arrival/${id}`,
		method: 'post',
		data: {
			imgUrl
		},
	});
}
// 签收
export function receipt(id) {
	return request({
		url: `/pigx-logistics/routePlanningInfo/receipt/${id}`,
		method: 'post',
		// data: query,
	});
}
// revoke 撤销
export function revoke(id) {
	return request({
		url: `/pigx-logistics/routePlanningInfo/revoke/${id}`,
		method: 'post',
		// data: query,
	});
}
//通过id查询排线
export function routePlanningInfoid(id) {
	return request({
		url: `/pigx-logistics/routePlanningInfo/${id}`,
		method: 'GET',
	});
}

export function assignDriver(query) {
	return request({
		url: `/pigx-logistics/routePlanningInfo/assignDriver`,
		method: 'post',
		data: query,
	});
}
// 确认排线
export function confirmRoutePlanning(query) {
	return request({
		url: `/pigx-logistics/routePlanningInfo/confirmRoutePlanning`,
		method: 'post',
		data: query,
	});
}
// logisticsOrder通过id删除物流订单
export function logisticsOrder(query) {
	return request({
		url: '/pigx-logistics/logisticsOrder',
		method: 'DELETE',
		data: query,
	});
}